﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 修改字段 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "FileUrl",
                table: "TShippingOrderDetails");

            migrationBuilder.CreateTable(
                name: "FileClass",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FileUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TShippingOrderDetailId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FileClass", x => x.Id);
                    table.ForeignKey(
                        name: "FK_FileClass_TShippingOrderDetails_TShippingOrderDetailId",
                        column: x => x.TShippingOrderDetailId,
                        principalTable: "TShippingOrderDetails",
                        principalColumn: "Id");
                });

            migrationBuilder.CreateIndex(
                name: "IX_FileClass_TShippingOrderDetailId",
                table: "FileClass",
                column: "TShippingOrderDetailId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "FileClass");

            migrationBuilder.AddColumn<string>(
                name: "FileUrl",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);
        }
    }
}
